package cn.ynu.cmrs.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class EmailAddrMatch {

	/**
	 * Use regular expressions to match the format of the email address entered in the parameters
	 * 
	 * @param addr The e-mail address that want to be matched
	 * @return Matching result
	 */
	public static Boolean emailAddrMatch(String addr) {
		Pattern p = Pattern.compile("[\\w[.-]]+@[\\w[.-]]+\\.[\\w]+");
		Matcher m = p.matcher(addr);
		return m.matches();
	}
}
